package com.ruoyi.lucky.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.lucky.mapper.TTakeoverMapper;
import com.ruoyi.lucky.domain.TTakeover;
import com.ruoyi.lucky.service.ITTakeoverService;
import com.ruoyi.common.core.text.Convert;

/**
 * 商品取货Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-11-12
 */
@Service
public class TTakeoverServiceImpl implements ITTakeoverService 
{
    @Autowired
    private TTakeoverMapper tTakeoverMapper;

    /**
     * 查询商品取货
     * 
     * @param toId 商品取货ID
     * @return 商品取货
     */
    @Override
    public TTakeover selectTTakeoverById(Long toId)
    {
        return tTakeoverMapper.selectTTakeoverById(toId);
    }

    /**
     * 查询商品取货列表
     * 
     * @param tTakeover 商品取货
     * @return 商品取货
     */
    @Override
    public List<TTakeover> selectTTakeoverList(TTakeover tTakeover)
    {
        return tTakeoverMapper.selectTTakeoverList(tTakeover);
    }

    /**
     * 新增商品取货
     * 
     * @param tTakeover 商品取货
     * @return 结果
     */
    @Override
    public int insertTTakeover(TTakeover tTakeover)
    {
        tTakeover.setCreateTime(DateUtils.getNowDate());
        return tTakeoverMapper.insertTTakeover(tTakeover);
    }

    /**
     * 修改商品取货
     * 
     * @param tTakeover 商品取货
     * @return 结果
     */
    @Override
    public int updateTTakeover(TTakeover tTakeover)
    {
        tTakeover.setUpdateTime(DateUtils.getNowDate());
        return tTakeoverMapper.updateTTakeover(tTakeover);
    }

    /**
     * 删除商品取货对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteTTakeoverByIds(String ids)
    {
        return tTakeoverMapper.deleteTTakeoverByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商品取货信息
     * 
     * @param toId 商品取货ID
     * @return 结果
     */
    @Override
    public int deleteTTakeoverById(Long toId)
    {
        return tTakeoverMapper.deleteTTakeoverById(toId);
    }
}
